<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6_ng-click</title>
    <script src="../lib/angularjs.js"></script>
</head>

<body ng-app="myApp" ng-controller="appCtrl">
    <button ng-click="add()">OK</button>
    <p>{{count}}</p>
</body>
<script>
    const app = angular.module("myApp", [])
    app.controller("appCtrl", ["$scope", function ($scope) {
        $scope.count = 0
        $scope.add = function () {
            this.count += 1
        }
    }])
</script>

</html>